define
(    
    function()
    {        
        ElementModifyAction = function(taskChangeId, frameChangeId, elements)
        {          
            if (!elements)
            {
                throw "elements cannot be null";
            }

            this.toJSON = function()
            {
                var shapeElements = [];

                for (var i = 0; i < elements.length; i++)
                {
                    var shapeJSON = elements[i].toObject();
                    shapeJSON.changeId = elements[i].changeId;
                    shapeElements.push(shapeJSON);
                }

                return {id: this.id, taskChangeId: taskChangeId, frameChangeId: frameChangeId, elements: shapeElements};
            };
        };

        ElementModifyAction.prototype.id = ElementModifyAction.id = "ElementModifyAction";
        return ElementModifyAction;        
    }
);